<?php
declare (strict_types = 1);

namespace app\listener;

class WsLeave
{
    /**
     * 事件监听处理
     *
     * @return mixed
     */
    public function handle($event)
    {
        //
        //
        $ws = app('think\swoole\Websocket');
        //
        $roomobj = app('think\swoole\websocket\Room');
        // 当前客户端离开指定room
        $ws->leave($event['room']);




        var_dump($roomobj->getClients($event['room']));


        $ws->emit('leavecallback', '房间离开成功');

    }    
}
